<template>
<div class="base-container">
    <el-container>
        <el-header>
            <head-nav></head-nav>
        </el-header>
        <el-container>
            <el-aside :width="!isCollapse?'201px':'60px'">
                <nav-menu></nav-menu>
            </el-aside>
            <el-container>
                <el-main id="scrollBox">
                    <div class="router-view">
                        <bread-crumb></bread-crumb>
                        <router-view />
                    </div>
                </el-main>
            </el-container>
        </el-container>
    </el-container>
</div>
</template>

<script>
import NavMenu from '@/views/menu/NavMenu'
import HeadNav from '@/views/menu/HeadNav'
import BreadCrumb from '@/views/menu/BreadCrumb'
import { mapGetters, mapMutations } from 'vuex'
export default {
    name: 'container',
    components: {
        NavMenu,
        HeadNav,
        BreadCrumb
    },
    computed: {
        ...mapGetters({
            isCollapse: 'common/getCollapse'
        })
    },
    watch: {
        $route (val) {
            this.setCollapse(val.path === '/experiment/editExp')
        }
    },
    methods: {
        ...mapMutations({
            setCollapse: 'common/setCollapse'
        })
    }
}
</script>

<style lang="less">
@import './common.less';

.base-container {
    width: 100%;
    height: 100%;
    .router-view {
        background: #ffffff;
        padding: 10px;
    }

    .el-header {
        background-color: #070F1C;
        text-align: center;
        line-height: 60px;
    }

    .el-aside {
        text-align: center;
        line-height: 200px;
    }

    .el-container,
    .el-menu {
        width: 100%;
        height: 100%;
    }
    .el-main {
        background: #EBEEF5;
        position: relative;
    }
}
</style>
